'use strict';
module.exports = (app) => {
  // 项目表
  const { INTEGER, STRING } = app.Sequelize;
  const Project = app.model.define('w_project', {
    id: { type: INTEGER, primaryKey: true, autoIncrement: true },
    name: {
      type: STRING,
      comment: '项目名称',
    },
    user_id: {
      type: INTEGER,
      comment: '用户id',
    },
    title: {
      type: STRING,
      comment: '平台名称',
    },
    logo: {
      type: STRING(999),
      comment: '平台logo',
    },
    desc: {
      type: STRING,
      comment: '平台简介',
      allowNull: true,
    },
    url: {
      type: STRING,
      comment: '项目展示地址',
      allowNull: true,
    },
  });

  // Project.associate = function () {
  //   Project.belongsTo(app.model.Tables.Com.Admin, {
  //     foreignKey: 'user_id',
  //   });
  // };

  // (async () => {
  //   await Project.sync({ alter: true });
  //   // 这里是代码
  // })();

  return Project;
};
